public class Author {

	String authorName;
	
	public Author(String authorName)
	{
		this.authorName = authorName;
	}
	
	public void Authorize(Book.RelatedWork work)
	{
		Author workAuthor = work.workAuthor;
	}
	
    public static class ElementList {
        public int size;
        public Element[] data = new Element[120];
        /** Adds an element to list, resizing if necessary. */
        public void addElement(Element element) {
            if (size == data.length) {
                Element[] newarray = new Element[size + 20];
                System.arraycopy(data, 0, newarray, 0, size);
                data = newarray;
            }
            data[size++] = element;
        }
    }
    
    public static class Element {
        public static final int INLINE = 0x01;
        public static final int BLOCK = 0x02;
        public static final int EMPTY = 0x04;
        public static final int CONTAINER = 0x08;
        public static final int SPECIAL = 0x10;
        private static final short[] EMPTY_ARRAY = new short[0];
        public short code;
        public String name;
        public int flags;
        public short[] parentCodes;
        public Element[] parent;
        public short bounds;
        public short[] closes;

        public Element(short code, String name, int flags, 
                       short parent, short[] closes) {
            this(code, name, flags, new short[]{parent}, (short)-1, closes);
        }

        public Element(short code, String name, int flags, 
                       short parent, short bounds, short[] closes) {
            this(code, name, flags, new short[]{parent}, bounds, closes);
        }

        public Element(short code, String name, int flags, 
                       short[] parents, short[] closes) {
            this(code, name, flags, parents, (short)-1, closes);
        }

        public Element(short code, String name, int flags, 
                       short[] parents, short bounds, short[] closes) {
            this.code = code;
            this.name = name;
            this.flags = flags;
            this.parentCodes = parents;
            this.parent = null;
            this.bounds = bounds;
            this.closes = closes;
        }

        public final boolean isInline() {
            return (flags & INLINE) != 0;
        }

        public final boolean isBlock() {
            return (flags & BLOCK) != 0;
        }

        public final boolean isEmpty() {
            return (flags & EMPTY) != 0;
        }

        public final boolean isContainer() {
            return (flags & CONTAINER) != 0;
        }

        public final boolean isSpecial() {
            return (flags & SPECIAL) != 0;
        }

        public boolean closes(short tag) {

            if (closes != null) {
                for (int i = 0; i < closes.length; i++) {
                    if (closes[i] == tag) {
                        return true;
                    }
                }
            }
            return false;

        }

        public int hashCode() {
            return name.hashCode();
        }

        public boolean equals(Object o) {
            return name.equals(o);
        }
    }

}
